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

Side by Side Diff: components/enhanced_bookmarks/bookmark_server_search_service.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/enhanced_bookmarks/bookmark_server_search_service.h" 5 #include "components/enhanced_bookmarks/bookmark_server_search_service.h"
6 6
7 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h" 7 #include "components/enhanced_bookmarks/enhanced_bookmark_model.h"
8 #include "components/enhanced_bookmarks/enhanced_bookmark_utils.h" 8 #include "components/enhanced_bookmarks/enhanced_bookmark_utils.h"
9 #include "components/enhanced_bookmarks/proto/search.pb.h" 9 #include "components/enhanced_bookmarks/proto/search.pb.h"
10 #include "net/base/url_util.h" 10 #include "net/base/url_util.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 scoped_ptr<net::URLFetcher> BookmarkServerSearchService::CreateFetcher() { 71 scoped_ptr<net::URLFetcher> BookmarkServerSearchService::CreateFetcher() {
72 // Add the necessary arguments to the URI. 72 // Add the necessary arguments to the URI.
73 GURL url(kSearchUrl); 73 GURL url(kSearchUrl);
74 url = net::AppendQueryParameter(url, "output", "proto"); 74 url = net::AppendQueryParameter(url, "output", "proto");
75 url = net::AppendQueryParameter(url, "q", current_query_); 75 url = net::AppendQueryParameter(url, "q", current_query_);
76 url = net::AppendQueryParameter(url, "v", model_->GetVersionString()); 76 url = net::AppendQueryParameter(url, "v", model_->GetVersionString());
77 77
78 // Build the URLFetcher to perform the request. 78 // Build the URLFetcher to perform the request.
79 scoped_ptr<net::URLFetcher> url_fetcher( 79 scoped_ptr<net::URLFetcher> url_fetcher =
80 net::URLFetcher::Create(url, net::URLFetcher::GET, this)); 80 net::URLFetcher::Create(url, net::URLFetcher::GET, this);
81 81
82 return url_fetcher; 82 return url_fetcher;
83 } 83 }
84 84
85 bool BookmarkServerSearchService::ProcessResponse(const std::string& response, 85 bool BookmarkServerSearchService::ProcessResponse(const std::string& response,
86 bool* should_notify) { 86 bool* should_notify) {
87 DCHECK(*should_notify); 87 DCHECK(*should_notify);
88 DCHECK(current_query_.length()); 88 DCHECK(current_query_.length());
89 image::collections::CorpusSearchResult response_proto; 89 image::collections::CorpusSearchResult response_proto;
90 bool result = response_proto.ParseFromString(response); 90 bool result = response_proto.ParseFromString(response);
(...skipping 27 matching lines...) Expand all
118 cache_.Clear(); 118 cache_.Clear();
119 } 119 }
120 120
121 void BookmarkServerSearchService::EnhancedBookmarkRemoteIdChanged( 121 void BookmarkServerSearchService::EnhancedBookmarkRemoteIdChanged(
122 const BookmarkNode* node, 122 const BookmarkNode* node,
123 const std::string& old_remote_id, 123 const std::string& old_remote_id,
124 const std::string& remote_id) { 124 const std::string& remote_id) {
125 cache_.Clear(); 125 cache_.Clear();
126 } 126 }
127 } // namespace enhanced_bookmarks 127 } // namespace enhanced_bookmarks
OLDNEW
« no previous file with comments | « components/enhanced_bookmarks/bookmark_server_cluster_service.cc ('k') | components/feedback/feedback_uploader_chrome.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698