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

Side by Side Diff: chrome/common/content_settings_pattern.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
« no previous file with comments | « chrome/common/content_settings_pattern.h ('k') | chrome/common/extensions/extension_messages.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 (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/common/content_settings_pattern.h" 5 #include "chrome/common/content_settings_pattern.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 : parts_(parts), 396 : parts_(parts),
397 is_valid_(valid) { 397 is_valid_(valid) {
398 } 398 }
399 399
400 void ContentSettingsPattern::WriteToMessage(IPC::Message* m) const { 400 void ContentSettingsPattern::WriteToMessage(IPC::Message* m) const {
401 IPC::WriteParam(m, is_valid_); 401 IPC::WriteParam(m, is_valid_);
402 IPC::WriteParam(m, parts_); 402 IPC::WriteParam(m, parts_);
403 } 403 }
404 404
405 bool ContentSettingsPattern::ReadFromMessage(const IPC::Message* m, 405 bool ContentSettingsPattern::ReadFromMessage(const IPC::Message* m,
406 void** iter) { 406 PickleIterator* iter) {
407 return IPC::ReadParam(m, iter, &is_valid_) && 407 return IPC::ReadParam(m, iter, &is_valid_) &&
408 IPC::ReadParam(m, iter, &parts_); 408 IPC::ReadParam(m, iter, &parts_);
409 } 409 }
410 410
411 bool ContentSettingsPattern::Matches( 411 bool ContentSettingsPattern::Matches(
412 const GURL& url) const { 412 const GURL& url) const {
413 // An invalid pattern matches nothing. 413 // An invalid pattern matches nothing.
414 if (!is_valid_) 414 if (!is_valid_)
415 return false; 415 return false;
416 416
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 if (!parts.is_port_wildcard && other_parts.is_port_wildcard) 635 if (!parts.is_port_wildcard && other_parts.is_port_wildcard)
636 return ContentSettingsPattern::PREDECESSOR; 636 return ContentSettingsPattern::PREDECESSOR;
637 637
638 int result = parts.port.compare(other_parts.port); 638 int result = parts.port.compare(other_parts.port);
639 if (result == 0) 639 if (result == 0)
640 return ContentSettingsPattern::IDENTITY; 640 return ContentSettingsPattern::IDENTITY;
641 if (result > 0) 641 if (result > 0)
642 return ContentSettingsPattern::DISJOINT_ORDER_PRE; 642 return ContentSettingsPattern::DISJOINT_ORDER_PRE;
643 return ContentSettingsPattern::DISJOINT_ORDER_POST; 643 return ContentSettingsPattern::DISJOINT_ORDER_POST;
644 } 644 }
OLDNEW
« no previous file with comments | « chrome/common/content_settings_pattern.h ('k') | chrome/common/extensions/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698