| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 new_msg->WriteInt(browser_plugin_instance_id()); | 602 new_msg->WriteInt(browser_plugin_instance_id()); |
| 603 | 603 |
| 604 // Copy remaining payload from original message. | 604 // Copy remaining payload from original message. |
| 605 // TODO(wjmaclean): it would be nice if IPC::PickleIterator had a method | 605 // TODO(wjmaclean): it would be nice if IPC::PickleIterator had a method |
| 606 // like 'RemainingBytes()' so that we don't have to include implementation- | 606 // like 'RemainingBytes()' so that we don't have to include implementation- |
| 607 // specific details like sizeof() in the next line. | 607 // specific details like sizeof() in the next line. |
| 608 DCHECK(msg->payload_size() > sizeof(int)); | 608 DCHECK(msg->payload_size() > sizeof(int)); |
| 609 size_t remaining_bytes = msg->payload_size() - sizeof(int); | 609 size_t remaining_bytes = msg->payload_size() - sizeof(int); |
| 610 const char* data = nullptr; | 610 const char* data = nullptr; |
| 611 bool read_success = iter.ReadBytes(&data, remaining_bytes); | 611 bool read_success = iter.ReadBytes(&data, remaining_bytes); |
| 612 CHECK(read_success) | 612 // Unexpected failure reading remaining IPC::Message payload. |
| 613 << "Unexpected failure reading remaining IPC::Message payload."; | 613 CHECK(read_success); |
| 614 bool write_success = new_msg->WriteBytes(data, remaining_bytes); | 614 bool write_success = new_msg->WriteBytes(data, remaining_bytes); |
| 615 CHECK(write_success) | 615 // Unexpected failure writing remaining IPC::Message payload. |
| 616 << "Unexpected failure writing remaining IPC::Message payload."; | 616 CHECK(write_success); |
| 617 | 617 |
| 618 return new_msg; | 618 return new_msg; |
| 619 } | 619 } |
| 620 | 620 |
| 621 void BrowserPluginGuest::SendQueuedMessages() { | 621 void BrowserPluginGuest::SendQueuedMessages() { |
| 622 if (!attached()) | 622 if (!attached()) |
| 623 return; | 623 return; |
| 624 | 624 |
| 625 while (!pending_messages_.empty()) { | 625 while (!pending_messages_.empty()) { |
| 626 std::unique_ptr<IPC::Message> message_ptr = | 626 std::unique_ptr<IPC::Message> message_ptr = |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 range, character_bounds); | 1063 range, character_bounds); |
| 1064 } | 1064 } |
| 1065 #endif | 1065 #endif |
| 1066 | 1066 |
| 1067 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1067 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
| 1068 if (delegate_) | 1068 if (delegate_) |
| 1069 delegate_->SetContextMenuPosition(position); | 1069 delegate_->SetContextMenuPosition(position); |
| 1070 } | 1070 } |
| 1071 | 1071 |
| 1072 } // namespace content | 1072 } // namespace content |
| OLD | NEW |