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

Side by Side Diff: webkit/glue/resource_fetcher.cc

Issue 1742004: Glue for sending/receiving cacheable metadata. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/resource_fetcher.h ('k') | webkit/glue/resource_loader_bridge.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "webkit/glue/resource_fetcher.h" 5 #include "webkit/glue/resource_fetcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" 8 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
9 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" 9 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h"
10 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" 10 #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 74
75 void ResourceFetcher::didReceiveData( 75 void ResourceFetcher::didReceiveData(
76 WebURLLoader* loader, const char* data, int data_length) { 76 WebURLLoader* loader, const char* data, int data_length) {
77 DCHECK(!completed_); 77 DCHECK(!completed_);
78 DCHECK(data_length > 0); 78 DCHECK(data_length > 0);
79 79
80 data_.append(data, data_length); 80 data_.append(data, data_length);
81 } 81 }
82 82
83 void ResourceFetcher::didReceiveCachedMetadata(
84 WebURLLoader* loader, const char* data, int data_length) {
85 DCHECK(!completed_);
86 DCHECK(data_length > 0);
87
88 metadata_.assign(data, data_length);
89 }
90
83 void ResourceFetcher::didFinishLoading(WebURLLoader* loader) { 91 void ResourceFetcher::didFinishLoading(WebURLLoader* loader) {
84 DCHECK(!completed_); 92 DCHECK(!completed_);
85 completed_ = true; 93 completed_ = true;
86 94
87 if (callback_.get()) { 95 if (callback_.get()) {
88 callback_->Run(response_, data_); 96 callback_->Run(response_, data_);
89 callback_.reset(); 97 callback_.reset();
90 } 98 }
91 } 99 }
92 100
(...skipping 19 matching lines...) Expand all
112 } 120 }
113 121
114 void ResourceFetcherWithTimeout::TimeoutFired() { 122 void ResourceFetcherWithTimeout::TimeoutFired() {
115 if (!completed_) { 123 if (!completed_) {
116 loader_->cancel(); 124 loader_->cancel();
117 didFail(NULL, WebURLError()); 125 didFail(NULL, WebURLError());
118 } 126 }
119 } 127 }
120 128
121 } // namespace webkit_glue 129 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/resource_fetcher.h ('k') | webkit/glue/resource_loader_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698