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

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: jar feedback 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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) { 1275 void UpdateTabFunction::WebContentsDestroyed(WebContents* tab) {
1276 CHECK_EQ(tab, web_contents_); 1276 CHECK_EQ(tab, web_contents_);
1277 web_contents_ = NULL; 1277 web_contents_ = NULL;
1278 } 1278 }
1279 1279
1280 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) { 1280 bool UpdateTabFunction::OnMessageReceived(const IPC::Message& message) {
1281 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID) 1281 if (message.type() != ExtensionHostMsg_ExecuteCodeFinished::ID)
1282 return false; 1282 return false;
1283 1283
1284 int message_request_id = -1; 1284 int message_request_id = -1;
1285 void* iter = NULL; 1285 PickleReader iter(message);
1286 if (!message.ReadInt(&iter, &message_request_id)) { 1286 if (!message.ReadInt(&iter, &message_request_id)) {
1287 NOTREACHED() << "malformed extension message"; 1287 NOTREACHED() << "malformed extension message";
1288 return true; 1288 return true;
1289 } 1289 }
1290 1290
1291 if (message_request_id != request_id()) 1291 if (message_request_id != request_id())
1292 return false; 1292 return false;
1293 1293
1294 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message) 1294 IPC_BEGIN_MESSAGE_MAP(UpdateTabFunction, message)
1295 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished, 1295 IPC_MESSAGE_HANDLER(ExtensionHostMsg_ExecuteCodeFinished,
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 // called for every API call the extension made. 1745 // called for every API call the extension made.
1746 GotLanguage(language); 1746 GotLanguage(language);
1747 } 1747 }
1748 1748
1749 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { 1749 void DetectTabLanguageFunction::GotLanguage(const std::string& language) {
1750 result_.reset(Value::CreateStringValue(language.c_str())); 1750 result_.reset(Value::CreateStringValue(language.c_str()));
1751 SendResponse(true); 1751 SendResponse(true);
1752 1752
1753 Release(); // Balanced in Run() 1753 Release(); // Balanced in Run()
1754 } 1754 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698