forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BlobAsync] Patch 2: Common Constants
This CL contains constants for the Blob Async Transport refactor. Note: This CL is currently a no-op, hookup is in the 'Hookup' patch. Patches: 1: https://codereview.chromium.org/1287303002 (Committed!) 2: https://codereview.chromium.org/1288373002 3: https://codereview.chromium.org/1292523002 4: https://codereview.chromium.org/1098853003 Hookup: https://codereview.chromium.org/1234813004 BUG=375297 Review URL: https://codereview.chromium.org/1288373002 Cr-Commit-Position: refs/heads/master@{#357248}
- Loading branch information
Showing
17 changed files
with
533 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "storage/common/blob_storage/blob_item_bytes_request.h" | ||
|
||
namespace storage { | ||
|
||
BlobItemBytesRequest BlobItemBytesRequest::CreateIPCRequest( | ||
size_t request_number, | ||
size_t renderer_item_index, | ||
size_t renderer_item_offset, | ||
size_t size) { | ||
return BlobItemBytesRequest(request_number, IPCBlobItemRequestStrategy::IPC, | ||
renderer_item_index, renderer_item_offset, size, | ||
kInvalidIndex, kInvalidSize); | ||
} | ||
BlobItemBytesRequest BlobItemBytesRequest::CreateSharedMemoryRequest( | ||
size_t request_number, | ||
size_t renderer_item_index, | ||
size_t renderer_item_offset, | ||
size_t size, | ||
size_t handle_index, | ||
uint64_t handle_offset) { | ||
return BlobItemBytesRequest(request_number, | ||
IPCBlobItemRequestStrategy::SHARED_MEMORY, | ||
renderer_item_index, renderer_item_offset, size, | ||
handle_index, handle_offset); | ||
} | ||
|
||
BlobItemBytesRequest BlobItemBytesRequest::CreateFileRequest( | ||
size_t request_number, | ||
size_t renderer_item_index, | ||
uint64_t renderer_item_offset, | ||
uint64_t size, | ||
size_t handle_index, | ||
uint64_t handle_offset) { | ||
return BlobItemBytesRequest(request_number, IPCBlobItemRequestStrategy::FILE, | ||
renderer_item_index, renderer_item_offset, size, | ||
handle_index, handle_offset); | ||
} | ||
|
||
BlobItemBytesRequest::BlobItemBytesRequest() | ||
: request_number(kInvalidIndex), | ||
transport_strategy(IPCBlobItemRequestStrategy::UNKNOWN), | ||
renderer_item_index(kInvalidIndex), | ||
renderer_item_offset(kInvalidSize), | ||
size(kInvalidSize), | ||
handle_index(kInvalidIndex), | ||
handle_offset(kInvalidSize) {} | ||
|
||
BlobItemBytesRequest::BlobItemBytesRequest( | ||
size_t request_number, | ||
IPCBlobItemRequestStrategy transport_strategy, | ||
size_t renderer_item_index, | ||
uint64_t renderer_item_offset, | ||
uint64_t size, | ||
size_t handle_index, | ||
uint64_t handle_offset) | ||
: request_number(request_number), | ||
transport_strategy(transport_strategy), | ||
renderer_item_index(renderer_item_index), | ||
renderer_item_offset(renderer_item_offset), | ||
size(size), | ||
handle_index(handle_index), | ||
handle_offset(handle_offset) {} | ||
|
||
BlobItemBytesRequest::~BlobItemBytesRequest() {} | ||
|
||
void PrintTo(const BlobItemBytesRequest& request, std::ostream* os) { | ||
*os << "{request_number: " << request.request_number | ||
<< ", transport_strategy: " | ||
<< static_cast<int>(request.transport_strategy) | ||
<< ", renderer_item_index: " << request.renderer_item_index | ||
<< ", renderer_item_offset: " << request.renderer_item_offset | ||
<< ", size: " << request.size | ||
<< ", handle_index: " << request.handle_index | ||
<< ", handle_offset: " << request.handle_offset << "}"; | ||
} | ||
|
||
} // namespace storage |
Oops, something went wrong.