Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: ipc/brokerable_attachment.cc

Issue 1317093007: ipc: Make a new class PlaceholderBrokerableAttachment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More rebase errors. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/brokerable_attachment.h ('k') | ipc/handle_attachment_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/brokerable_attachment.h" 5 #include "ipc/brokerable_attachment.h"
6 6
7 #include "ipc/attachment_broker.h" 7 #include "ipc/attachment_broker.h"
8 8
9 #if USE_ATTACHMENT_BROKER 9 #if USE_ATTACHMENT_BROKER
10 #include "crypto/random.h" 10 #include "crypto/random.h"
(...skipping 23 matching lines...) Expand all
34 nonce[i] = start_address[i]; 34 nonce[i] = start_address[i];
35 } 35 }
36 36
37 void BrokerableAttachment::AttachmentId::SerializeToBuffer(char* start_address, 37 void BrokerableAttachment::AttachmentId::SerializeToBuffer(char* start_address,
38 size_t size) { 38 size_t size) {
39 DCHECK(size == BrokerableAttachment::kNonceSize); 39 DCHECK(size == BrokerableAttachment::kNonceSize);
40 for (size_t i = 0; i < BrokerableAttachment::kNonceSize; ++i) 40 for (size_t i = 0; i < BrokerableAttachment::kNonceSize; ++i)
41 start_address[i] = nonce[i]; 41 start_address[i] = nonce[i];
42 } 42 }
43 43
44 BrokerableAttachment::BrokerableAttachment() 44 BrokerableAttachment::BrokerableAttachment() {}
45 : needs_brokering_(false) {}
46 45
47 BrokerableAttachment::BrokerableAttachment(const AttachmentId& id, 46 BrokerableAttachment::BrokerableAttachment(const AttachmentId& id) : id_(id) {}
48 bool needs_brokering)
49 : id_(id), needs_brokering_(needs_brokering) {}
50 47
51 BrokerableAttachment::~BrokerableAttachment() { 48 BrokerableAttachment::~BrokerableAttachment() {}
52 }
53 49
54 BrokerableAttachment::AttachmentId BrokerableAttachment::GetIdentifier() const { 50 BrokerableAttachment::AttachmentId BrokerableAttachment::GetIdentifier() const {
55 return id_; 51 return id_;
56 } 52 }
57 53
58 bool BrokerableAttachment::NeedsBrokering() const { 54 bool BrokerableAttachment::NeedsBrokering() const {
59 return needs_brokering_; 55 return GetBrokerableType() == PLACEHOLDER;
60 }
61
62 void BrokerableAttachment::SetNeedsBrokering(bool needs_brokering) {
63 needs_brokering_ = needs_brokering;
64 } 56 }
65 57
66 BrokerableAttachment::Type BrokerableAttachment::GetType() const { 58 BrokerableAttachment::Type BrokerableAttachment::GetType() const {
67 return TYPE_BROKERABLE_ATTACHMENT; 59 return TYPE_BROKERABLE_ATTACHMENT;
68 } 60 }
69 61
62 #if defined(OS_POSIX)
63 base::PlatformFile BrokerableAttachment::TakePlatformFile() {
64 NOTREACHED();
65 return base::PlatformFile();
66 }
67 #endif // OS_POSIX
68
70 } // namespace IPC 69 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/brokerable_attachment.h ('k') | ipc/handle_attachment_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698