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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 base::PickleIterator iter(*msg); | 549 base::PickleIterator iter(*msg); |
550 if (!iter.ReadInt(&msg_browser_plugin_instance_id) || | 550 if (!iter.ReadInt(&msg_browser_plugin_instance_id) || |
551 msg_browser_plugin_instance_id != browser_plugin::kInstanceIDNone) { | 551 msg_browser_plugin_instance_id != browser_plugin::kInstanceIDNone) { |
552 return msg; | 552 return msg; |
553 } | 553 } |
554 | 554 |
555 // This method may be called with no browser_plugin_instance_id in tests. | 555 // This method may be called with no browser_plugin_instance_id in tests. |
556 if (!browser_plugin_instance_id()) | 556 if (!browser_plugin_instance_id()) |
557 return msg; | 557 return msg; |
558 | 558 |
559 scoped_ptr<IPC::Message> new_msg( | 559 std::unique_ptr<IPC::Message> new_msg( |
560 new IPC::Message(msg->routing_id(), msg->type(), msg->priority())); | 560 new IPC::Message(msg->routing_id(), msg->type(), msg->priority())); |
561 new_msg->WriteInt(browser_plugin_instance_id()); | 561 new_msg->WriteInt(browser_plugin_instance_id()); |
562 | 562 |
563 // Copy remaining payload from original message. | 563 // Copy remaining payload from original message. |
564 // TODO(wjmaclean): it would be nice if IPC::PickleIterator had a method | 564 // TODO(wjmaclean): it would be nice if IPC::PickleIterator had a method |
565 // like 'RemainingBytes()' so that we don't have to include implementation- | 565 // like 'RemainingBytes()' so that we don't have to include implementation- |
566 // specific details like sizeof() in the next line. | 566 // specific details like sizeof() in the next line. |
567 DCHECK(msg->payload_size() > sizeof(int)); | 567 DCHECK(msg->payload_size() > sizeof(int)); |
568 size_t remaining_bytes = msg->payload_size() - sizeof(int); | 568 size_t remaining_bytes = msg->payload_size() - sizeof(int); |
569 const char* data = nullptr; | 569 const char* data = nullptr; |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 range, character_bounds); | 1002 range, character_bounds); |
1003 } | 1003 } |
1004 #endif | 1004 #endif |
1005 | 1005 |
1006 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1006 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
1007 if (delegate_) | 1007 if (delegate_) |
1008 delegate_->SetContextMenuPosition(position); | 1008 delegate_->SetContextMenuPosition(position); |
1009 } | 1009 } |
1010 | 1010 |
1011 } // namespace content | 1011 } // namespace content |
OLD | NEW |