OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/support/weburl_loader_mock_factory.h" | 5 #include "webkit/support/weburl_loader_mock_factory.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.
h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRespon
se.h" |
13 #include "webkit/support/weburl_loader_mock.h" | 13 #include "webkit/support/weburl_loader_mock.h" |
14 | 14 |
15 using WebKit::WebData; | 15 using WebKit::WebData; |
16 using WebKit::WebString; | 16 using WebKit::WebString; |
17 using WebKit::WebURL; | 17 using WebKit::WebURL; |
18 using WebKit::WebURLError; | 18 using WebKit::WebURLError; |
19 using WebKit::WebURLLoader; | 19 using WebKit::WebURLLoader; |
20 using WebKit::WebURLRequest; | 20 using WebKit::WebURLRequest; |
21 using WebKit::WebURLResponse; | 21 using WebKit::WebURLResponse; |
22 | 22 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 scoped_array<char> buffer(new char[size]); | 137 scoped_array<char> buffer(new char[size]); |
138 data->reset(); | 138 data->reset(); |
139 int read_count = file_util::ReadFile(file_path, buffer.get(), size); | 139 int read_count = file_util::ReadFile(file_path, buffer.get(), size); |
140 if (read_count == -1) | 140 if (read_count == -1) |
141 return false; | 141 return false; |
142 DCHECK(read_count == size); | 142 DCHECK(read_count == size); |
143 data->assign(buffer.get(), size); | 143 data->assign(buffer.get(), size); |
144 | 144 |
145 return true; | 145 return true; |
146 } | 146 } |
OLD | NEW |