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

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/extensions/extension_tabs_module.h" 5 #include "chrome/browser/extensions/extension_tabs_module.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) { 1352 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) {
1353 CHECK_EQ(tab, web_contents_); 1353 CHECK_EQ(tab, web_contents_);
1354 web_contents_ = NULL; 1354 web_contents_ = NULL;
1355 } 1355 }
1356 1356
1357 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) { 1357 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) {
1358 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID) 1358 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID)
1359 return false; 1359 return false;
1360 1360
1361 int message_request_id = -1; 1361 int message_request_id = -1;
1362 void* iter = NULL; 1362 PickleIterator iter(message);
1363 if (!message.ReadInt(&iter, &message_request_id)) { 1363 if (!message.ReadInt(&iter, &message_request_id)) {
1364 NOTREACHED() << "malformed extension message"; 1364 NOTREACHED() << "malformed extension message";
1365 return true; 1365 return true;
1366 } 1366 }
1367 1367
1368 if (message_request_id != request_id()) 1368 if (message_request_id != request_id())
1369 return false; 1369 return false;
1370 1370
1371 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message) 1371 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message)
1372 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, 1372 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished,
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 // called for every API call the extension made. 1809 // called for every API call the extension made.
1810 GotLanguage(language); 1810 GotLanguage(language);
1811 } 1811 }
1812 1812
1813 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { 1813 void DetectTabLanguageFunction::GotLanguage(const std::string& language) {
1814 result_.reset(Value::CreateStringValue(language.c_str())); 1814 result_.reset(Value::CreateStringValue(language.c_str()));
1815 SendResponse(true); 1815 SendResponse(true);
1816 1816
1817 Release(); // Balanced in Run() 1817 Release(); // Balanced in Run()
1818 } 1818 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_page_capture_api.cc ('k') | chrome/browser/importer/profile_import_process_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698